function deleteAccessRow(e){landingAccessSelected[BX.data(BX(e),"id")]=false;BX.remove(BX.findParent(BX(e),{tag:"tr"},true))}(function(){"use strict";BX.namespace("BX.Landing");var e=BX.Landing.Utils.slice;var t=BX.Landing.Utils.proxy;var i=BX.Landing.Utils.bind;var o=BX.Landing.Utils.addClass;var r=BX.Landing.Utils.removeClass;var a=BX.Landing.Utils.isNumber;var s=BX.Landing.Utils.data;BX.Landing.ColorPalette=function(){this.themesPalete=document.querySelector(".landing-template-preview-themes");this.themesSiteCustomColorNode=document.querySelector(".landing-template-preview-site-custom-color");this.init();return this};BX.Landing.ColorPalette.getInstance=function(e){return BX.Landing.ColorPalette.instance||(BX.Landing.ColorPalette.instance=new BX.Landing.ColorPalette(e))};BX.Landing.ColorPalette.prototype={init:function(){var t;if(this.themesPalete){t=e(this.themesPalete.children)}if(this.themesSiteColorNode){t=t.concat(e(this.themesSiteColorNode.children))}if(this.themesSiteCustomColorNode){t=t.concat(e(this.themesSiteCustomColorNode.children))}if(t){t.forEach(this.initSelectableItem,this)}if(this.siteGroupPalette){var o=e(this.siteGroupPalette.children);o.forEach(this.initSelectableItem,this)}i(this.previewFrame,"load",this.onFrameLoad);i(this.closeButton,"click",this.onCancelButtonClick);if(!this.disableClickHandler){i(this.createButton,"click",this.onCreateButtonClick)}if(t){this.setColor()}},setColor:function(e){if(e===undefined){this.color=s(this.getActiveColorNode(),"data-value")}else{this.color=e}var t=document.getElementById("colorpicker");if(t){t.setAttribute("value",this.color)}},getActiveColorNode:function(){var e;if(this.themesPalete){e=this.themesPalete.querySelector(".active")}if(!e&&this.themesSiteColorNode){e=this.themesSiteColorNode.querySelector(".active")}if(!e&&this.themesSiteCustomColorNode){e=this.themesSiteCustomColorNode.querySelector(".active")}if(!e&&this.themesPalete){e=this.themesPalete.firstElementChild}return e},getActiveSiteGroupItem:function(){return this.siteGroupPalette.querySelector(".active")},loadPreview:function(e){return function(){return new Promise(function(t){if(this.previewFrame.src!==e){this.previewFrame.src=e;this.previewFrame.onload=function(){t(this.previewFrame)}.bind(this);return}t(this.previewFrame)}.bind(this))}.bind(this)},showLoader:function(){return new Promise(function(e){void this.loader.show(this.loaderContainer);o(this.imageContainer,"landing-template-preview-overlay");e()}.bind(this))},hideLoader:function(){return function(e){return new Promise(function(t){void this.loader.hide();r(this.imageContainer,"landing-template-preview-overlay");t(e)}.bind(this))}.bind(this)},delay:function(e){e=a(e)?e:0;return function(t){return new Promise((function(i){setTimeout(i.bind(null,t),e)}))}},getValue:function(){var e={};if(this.themesSiteColorNode&&this.getActiveColorNode().parentElement===this.themesSiteColorNode){e[s(this.themesSiteColorNode,"data-name")]="Y"}if(this.siteGroupPalette){e[s(this.siteGroupPalette,"data-name")]=s(this.getActiveSiteGroupItem(),"data-value")}e[s(this.themesPalete,"data-name")]=s(this.getActiveColorNode(),"data-value");e[s(this.themesSiteCustomColorNode,"data-name")]=s(this.getActiveColorNode(),"data-value");e[s(this.title,"data-name")]=this.title.value;e[s(this.description,"data-name")]=this.description.value;return e},onCancelButtonClick:function(e){e.preventDefault();top.BX.SidePanel.Instance.close()},onCreateButtonClick:function(e){e.preventDefault();if(this.isStore()&&this.IsLoadedFrame){this.loaderText=BX.create("div",{props:{className:"landing-template-preview-loader-text"},text:this.messages.LANDING_LOADER_WAIT});this.progressBar=new BX.UI.ProgressBar({column:true});this.progressBar.getContainer().classList.add("ui-progressbar-landing-preview");this.loaderContainer.appendChild(this.loaderText);this.loaderContainer.appendChild(this.progressBar.getContainer())}if(this.isStore()){if(this.IsLoadedFrame){this.showLoader();this.initCatalogParams();this.createCatalog()}}else{this.showLoader().then(this.delay(200)).then(function(){this.finalRedirectAjax(this.getCreateUrl())}.bind(this))}},initSelectableItem:function(e){i(e,"click",t(this.onSelectableItemClick,this))},onSelectableItemClick:function(e){e.preventDefault();if(e.currentTarget.parentElement===this.themesPalete||this.themesSiteColorNode&&e.currentTarget.parentElement===this.themesSiteColorNode||this.themesSiteCustomColorNode&&e.currentTarget.parentElement===this.themesSiteCustomColorNode){if(e.currentTarget.hasAttribute("data-value")){r(this.getActiveColorNode(),"active");o(e.currentTarget,"active");this.setColor(s(e.currentTarget,"data-value"))}}},isStore:function(){return this.createStore}};BX.Landing.ColorPicker=function(e,t){var i;if(t){i=t.defaultColor}this.picker=new BX.ColorPicker({bindElement:e,popupOptions:{angle:false,offsetTop:5},onColorSelected:this.onColorSelected.bind(this),colors:this.setColors(),selectedColor:i});this.input=e;this.colorPickerNode=e.parentElement;BX.addClass(this.colorPickerNode,"ui-colorpicker");this.colorIcon=BX.create("span",{props:{className:"ui-colorpicker-color"}});BX.insertBefore(this.colorIcon,this.input);this.colorValue=e.value;if(!this.colorValue&&i){e.value=i;this.colorValue=e.value}if(this.colorValue){BX.adjust(this.colorIcon,{attrs:{style:"background-color:"+this.colorValue}});BX.addClass(this.colorPickerNode,"ui-colorpicker-selected")}this.clearBtn=BX.create("span",{props:{className:"ui-colorpicker-clear"}});BX.insertAfter(this.clearBtn,this.input);BX.bind(this.colorPickerNode,"click",this.show.bind(this));BX.bind(this.clearBtn,"click",this.clear.bind(this))};BX.Landing.ColorPicker.prototype={onColorSelected:function(e){this.colorPickerNode.classList.add("ui-colorpicker-selected");this.colorIcon.style.backgroundColor=e;this.input.value=e;BX.Event.EventEmitter.emit(this,"BX.Landing.ColorPicker:onSelectColor")},show:function(e){if(e.target===this.clearBtn){return}this.picker.open()},clear:function(){this.colorPickerNode.classList.remove("ui-colorpicker-selected");this.input.value="";this.picker.setSelectedColor(null);BX.Event.EventEmitter.emit(this,"BX.Landing.ColorPicker:onClearColorPicker")},setColors:function(){return[["#f5f5f5","#eeeeee","#e0e0e0","#9e9e9e","#757575","#616161","#212121"],["#cfd8dc","#b0bec5","#90a4ae","#607d8b","#546e7a","#455a64","#263238"],["#d7ccc8","#bcaaa4","#a1887f","#795548","#6d4c41","#5d4037","#3e2723"],["#ffccbc","#ffab91","#ff8a65","#ff5722","#f4511e","#e64a19","#bf360c"],["#ffe0b2","#ffcc80","#ffb74d","#ff9800","#fb8c00","#f57c00","#e65100"],["#ffecb3","#ffe082","#ffd54f","#ffc107","#ffb300","#ffa000","#ff6f00"],["#fff9c4","#fff59d","#fff176","#ffeb3b","#fdd835","#fbc02d","#f57f17"],["#f0f4c3","#e6ee9c","#dce775","#cddc39","#c0ca33","#afb42b","#827717"],["#dcedc8","#c5e1a5","#aed581","#8bc34a","#7cb342","#689f38","#33691e"],["#c8e6c9","#a5d6a7","#81c784","#4caf50","#43a047","#388e3c","#1b5e20"],["#b2dfdb","#80cbc4","#4db6ac","#009688","#00897b","#00796b","#004d40"],["#b2ebf2","#80deea","#4dd0e1","#00bcd4","#00acc1","#0097a7","#006064"],["#b3e5fc","#81d4fa","#4fc3f7","#03a9f4","#039be5","#0288d1","#01579b"],["#bbdefb","#90caf9","#64b5f6","#2196f3","#1e88e5","#1976d2","#0d47a1"],["#c5cae9","#9fa8da","#7986cb","#3f51b5","#3949ab","#303f9f","#1a237e"],["#d1c4e9","#b39ddb","#9575cd","#673ab7","#5e35b1","#512da8","#311b92"],["#e1bee7","#ce93d8","#ba68c8","#9c27b0","#8e24aa","#7b1fa2","#4a148c"],["#f8bbd0","#f48fb1","#f06292","#e91e63","#d81b60","#c2185b","#880e4f"],["#ffcdd2","#ef9a9a","#e57373","#f44336","#e53935","#d32f2f","#b71c1c"]].map((function(e,t,i){return i.map((function(e){return e[t]}))}))}}})();
//# sourceMappingURL=landing-forms.map.js